/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task12.task1205;

/* 
动物识别
*/

public class Solution {

    public static void main(String[] args) {
        System.out.println(getObjectType(new Cow()));
        System.out.println(getObjectType(new Dog()));
        System.out.println(getObjectType(new Whale()));
        System.out.println(getObjectType(new Pig()));
    }

    public static String getObjectType(Object o) {
        //在此编写你的代码
        if (o instanceof Cow) {
            return "奶牛";
        } else if (o instanceof Dog) {
            return "狗";
        } else if (o instanceof Whale) {
            return "鲸鱼";
        } else
            return "未知动物";
    }

    public static class Cow {
    }

    public static class Dog {
    }

    public static class Whale {
    }

    public static class Pig {
    }
}
